Run Tests on Different Browsers
As we know, Selenium WebDriver supports different browsers like Chrome, Firefox, Edge, Internet Explorer, Safari, Opera, etc. So, we can run our test cases on different browsers using Selenium WebDriver. To run our test cases on different browsers, we need to download the browser driver for that browser. For example, if we want to run our test cases on Chrome browser, then we need to download the Chrome driver. Similarly , if we want to run our test cases on Firefox browser, then we need to download the Firefox driver. We can download the browser drivers from the below links:
Selenium WebDriver Testing on Chrome
Selenium WebDriver Testing on Edge
- Steps to write Code
- code is same as the Chrome but insteat of Chrome we write the Edge in this
- for example
- Instead of this code [ ChromeDriver driver=new ChromeDriver();]
- we write this code [ EdgeDriver driver=new EdgeDriver(); ]
- And the same Process for this Browser also
- And Run the Code
- the Output will be
Selenium WebDriver Testing on Firefox
- Steps to write Code
- code is same as the Chrome but insteat of Chrome we write the Firefox in this
- for example
- Instead of this code [ ChromeDriver driver=new ChromeDriver();]
- we write this code [ FirefoxDriver driver=new FirefoxDriver(); ]
- And the same Process for this Browser also
- And Run the Code
- the Output will be